package org.lejos.example;

import lejos.nxt.*;
import peggame.MoveChecker;
import peggame.pegmanager;
import Robot.*;
import peggame.Driver;

/**
 * Example leJOS Project with an ant build file
 *
 */
public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Take off every zig");
        Button.waitForPress();

        
        
    int next=0;
        while (next != -1) {
            switch (next) {
                case 0:
                    turnAround();
                    goForward();
                    turnAround();
                    break;
                case 1:
                    goForward();
                    break;
                case 2:
                    turnRight();
                    goForward();
                    turnLeft();
                    break;
                case 3:
                    turnLeft();
                    goForward();
                    turnRight();
                    break;
                default:
                    System.out.println("error");
            }
            //next = rh.getNextdirection();
 

        }

    }

    private static int Sum(int[][] in) {
        int out = 0;
        for (int[] i : in) {
            out += i.length;
        }
        return out;
    }

    private static void turnLeft() {
        Configureation.getPilot().rotate(90f);
    }

    private static void turnRight() {
        Configureation.getPilot().rotate(270f);
    }

    private static void turnAround() {
        Configureation.getPilot().rotate(180f);
    }

    private static void goForward() {
        Configureation.getPilot().travel((float) (15.5 * Constants.INtoCM * Constants.CMtoMM));
    }

    private static void turnLeftAndGoForward() {
        turnLeft();
        goForward();
    }

    private static void turnRightAndGoForward() {
        turnRight();
        goForward();
    }
}
